package com.yjs.houtai.service.serviceImpl;

import com.yjs.houtai.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.yjs.houtai.mapper.MemberMapper;
import com.yjs.houtai.entity.Member;
import com.yjs.houtai.service.MemberService;
@Service
public class MemberServiceImpl implements MemberService{

    @Resource
    private MemberMapper memberMapper;

    @Override
    public Message deleteByPrimaryKey(Integer memberId) {
        return memberMapper.deleteByPrimaryKey(memberId)==1?Message.success(null).add(memberMapper.selectByPrimaryKey(memberId)):Message.fail(null);
    }

    @Override
    public Message insert(Member member) {
        return null;
    }

    @Override
    public Message insertSelective(Member member) {
        return memberMapper.insertSelective(member)==1?Message.success(null).add(memberMapper.selectByPrimaryKey(member.getmemberId())):Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer memberId) {
        return memberMapper.selectByPrimaryKey(memberId)!=null?Message.success(null).add(memberMapper.selectByPrimaryKey(memberId)):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKeySelective(Member member) {
        return memberMapper.updateByPrimaryKeySelective(member)==1?Message.success(null).add(memberMapper.selectByPrimaryKey(member.getmemberId())):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(Member member) {
        return null;
    }

    @Override
    public Message selectAll() {
        return Message.success(null).add(memberMapper.selectAll());
    }

}
